#!/usr/bin/env python

import sys,platform

class UnsupportedPlatformException(Exception):
  pass

class CantLoadLibfaadException(Exception):
  pass

if platform.system()=="Windows":
  try:
    from faad_win import *
  except WindowsError,e:
    raise CantLoadLibfaadException(e.message)
elif platform.system()=="Linux":
  try:
    from faad_linux import *
  except OSError:
    raise CantLoadLibfaadException(e.message)
elif platform.system()=="Darwin":
  try:
    from faad_mac import *
  except OSError:
    raise CantLoadLibfaadException(e.message)
else:
  raise UnsupportedPlatformException("Now, Pyfaad supports only Windows, Linux or Mac.")

